#encoding=utf-8
#!/usr/bin/python



import os, sys, string,time,datetime

#gae 禁用了
#import http.cookiejar,  http.client
#import urllib.parse
#import urllib.request
from google.appengine.api import urlfetch

      
class snatch():
    def test(self,open_url=''):
        " 抓取 "
        if ( open_url == '' ):
            open_url = 'http://www.postimg.com/'
        result = urlfetch.fetch(open_url)
        if result.status_code == 200:
            page = result.content
        else:
            page = 'error'
        return page

class list_dir():
    def test(self,dir=''):
        " 目录列表 "
        if (dir == ''):
            dir = os.path.dirname(__file__)
        names = os.listdir(dir)
        return   names




